package com.guoxin.factory.absfactory.pizzastore.order;


import com.guoxin.factory.TypeUtils;
import com.guoxin.factory.absfactory.pizzastore.pizza.Pizza;

/**
 * @author Administrator
 */
public class OrderPizza {

    public OrderPizza(AbsFactory factory) {
        do {
            Pizza pizza;
            String type = TypeUtils.getType();
            pizza = factory.createPizza(type);
            if (pizza != null) {
                pizza.show();
            } else {
                System.out.println("订购失败~~~");
                break;
            }
        } while (true);
    }

}
